package cn.wenhe9.novel.auth;

import cn.wenhe9.novel.exception.NovelException;
import cn.wenhe9.novel.manager.UserInfoCacheManager;
import cn.wenhe9.novel.util.JwtUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 前台门户系统 认证策略
 *
 * @author DuJinliang
 * 2022/5/18
 */
@Component
@RequiredArgsConstructor
public class FrontAuthStrategy implements AuthStrategy {

    private final JwtUtils jwtUtils;

    private final UserInfoCacheManager userInfoCacheManager;

    @Override
    public void auth(String token) throws NovelException {
        // 统一账号认证
        authSSO(jwtUtils,userInfoCacheManager,token);
    }
}